home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / Visual Cafe Pro v1.0 / TUTORIAL.BIN / SpinButtonPanel.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-12-16  |  1.8 KB  |  77 lines

  1. package symantec.itools.awt;
  2.  
  3. import java.awt.Component;
  4. import java.awt.Container;
  5. import java.awt.Event;
  6. import java.awt.LayoutManager;
  7. import java.awt.Panel;
  8.  
  9. public class SpinButtonPanel extends Panel {
  10.    protected DirectionButton incButton;
  11.    protected DirectionButton decButton;
  12.  
  13.    public SpinButtonPanel() {
  14.       ((Container)this).add(this.incButton = new DirectionButton(2));
  15.       ((Container)this).add(this.decButton = new DirectionButton(3));
  16.    }
  17.  
  18.    public void setNotifyWhilePressed(boolean var1) {
  19.       this.incButton.setNotifyWhilePressed(var1);
  20.       this.decButton.setNotifyWhilePressed(var1);
  21.    }
  22.  
  23.    public boolean getNotifyWhilePressed() {
  24.       return this.incButton.getNotifyWhilePressed();
  25.    }
  26.  
  27.    public void setDelay(int var1) {
  28.       this.incButton.setNotifyDelay(var1);
  29.       this.decButton.setNotifyDelay(var1);
  30.    }
  31.  
  32.    public int getDelay() {
  33.       return this.incButton.getNotifyDelay();
  34.    }
  35.  
  36.    public boolean action(Event var1, Object var2) {
  37.       if (var1.target == this.incButton) {
  38.          ((Component)this).postEvent(new Event(this, 603, (Object)null));
  39.          return true;
  40.       } else if (var1.target == this.decButton) {
  41.          ((Component)this).postEvent(new Event(this, 604, (Object)null));
  42.          return true;
  43.       } else {
  44.          return false;
  45.       }
  46.    }
  47.  
  48.    public synchronized void enable() {
  49.       this.incButton.enable();
  50.       this.decButton.enable();
  51.    }
  52.  
  53.    public synchronized void disable() {
  54.       this.incButton.disable();
  55.       this.decButton.disable();
  56.    }
  57.  
  58.    public synchronized void enableUpButton() {
  59.       this.incButton.enable();
  60.    }
  61.  
  62.    public synchronized void enableDownButton() {
  63.       this.decButton.enable();
  64.    }
  65.  
  66.    public synchronized void disableUpButton() {
  67.       this.incButton.disable();
  68.    }
  69.  
  70.    public synchronized void disableDownButton() {
  71.       this.decButton.disable();
  72.    }
  73.  
  74.    public void setLayout(LayoutManager var1) {
  75.    }
  76. }
  77.